exports.request_decide = function(req, res, next) {
  if (req.session.adminuser) {
  	//获取用户已授权的访问资源
  	var grantedAuths = req.session.adminuser.grantedAuths;
  	//获取用户当前请求的路径资源
  	var requestPath = req.path;
  	if(grantedAuths){
  		var flag = false;
  		for(var i=0;i<grantedAuths.length;i++){
  			var resUrl = grantedAuths[i].resUrl;
  			if(resUrl == requestPath){
  				flag = true;
  				break;
  			}
  		}
  		if(flag){
  			next();
  		} else {
  			res.jsonp(200,{"success":false,"msg":'对不起，您沒有权限访问!',"error":'对不起，您沒有权限访问!'});
  		}
  	} else {
  		res.jsonp(200,{"success":false,"msg":'对不起，您沒有权限访问!',"error":'对不起，您沒有权限访问!'});
  	}
  } else {
    res.json(401,{"success":false,"msg":'用户未登陆',"error":'用户未登陆'});
  }
}